<template>
  <div>
    <van-nav-bar
      :title="title"
      :fixed="true"
      right-text="分享"
      left-arrow
      @click-left="onBack"
      @click-right="onShare"
    >
      <template #right>
        <van-icon name="share-o" size="20" />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
import { NavBar, Icon } from "vant";
export default {
  name: "NavBar",
  props: ["title", "onShare"],
  components: {
    [NavBar.name]: NavBar,
    [Icon.name]: Icon,
  },
  // 定义属性
  data() {
    return {};
  },
  // 方法集合
  methods: {},
};
</script>

<style lang="less">
@import "vant/lib/nav-bar/index.less";
@import "@/assets/css/common.less";
</style>
